package com.xltt.vehicleControl.bean;

import java.io.Serializable;


/**
 * @author zhaotengfei
 * @version 1.0.0
 * @created 2017/4/20 17:18
 */

public class ClimateStatus implements Serializable {
    public static final int SHOW_SUNROOF_UNKOWN = 30;
    public static final int SHOW_SUNFOOR_OPEN = 31;
    public static final int SHOW_SUNFOOR_ClOSE = 32;

    //天窗
    public static final int SUNROOF_POSITION_UNKNOWN = 0;
    public static final int SUNROOF_CLOSED = 1;
    public static final int SUNROOF_PRECOPEN_4 = 6;
    public static final int SUNROOF_PRECOPEN_96 = 7;
    public static final int SUNROOF_OPENED = 2;
    public static final int SUNROOF_MOVING = 8;
    //车窗
    public static final int WIN_POSITION_UNKNOWN = 3;
    public static final int WIN_CLOSED = 2;
    public static final int WIN_PRECOPEN_4 = 4;
    public static final int WIN_PRECOPEN_96 = 5;
    public static final int WIN_OPENED = 0;
    public static final int WIN_MOVING = 6;
    //座椅加热
    public static final int SEAT_HEAT_OFF = 0;
    public static final int SEAT_HEAT_LEVEL1 = 1;
    public static final int SEAT_HEAT_LEVEL2 = 2;
    public static final int SEAT_HEAT_LEVEL3 = 3;
    public static final int SEAT_NO_REQUEST = 7;
    //座椅透气
    public static final int SEAT_VENT_OFF = 0;
    public static final int SEAT_VENT_LEVEL1 = 1;
    public static final int SEAT_VENT_LEVEL2 = 2;
    public static final int SEAT_VENT_LEVEL3 = 3;
    public static final int SEAT_VENT_REQUEST = 7;

    public static final int AIR_CLEAN_OFF = 0;
    public static final int AIR_CLEAN_ON = 1;

    private Integer winStatusDriver;
    private Integer winStatusPassenger;
    private Integer winStatusDriverRear;
    private Integer winStatusPassengerRear;
    public Integer sunroofOpenStatus;
    private Float interiorTemp;
    private Float exteriorTemp;
    private Integer ventilateStatus;

    private Integer airCleanSts;//air conditioner clean status
    private Boolean preClimateActive;

    private Integer drvHeatSts;//driver seat heating status
    private Integer passHeatingSts;//front passenger seat heating status
    private Integer rlHeatingSts;//left rear seat heating status
    private Integer rrHeatingSts;//right rear seat heating status

    private Integer drvVentSts;//driver seat ventilation status
    private Integer passVentSts;//front passenger seat ventilation status
    private Integer rrVentSts;//right rear seat ventilation status
    private Integer rlVentSts;//left rear seat ventilation status

	//NOTICE 以下为v2新添
    //v2遮阳帘状态
    private String curtainOpenStatus;
    //遮阳帘未关警告
    private String curtainWarning;
    //遮阳帘开启百分比
    private String curtainPos;

    //    驾驶侧车窗位置未关窗告 (0: invalid 1: valid)
    private String winStatusDriverWarning;
    //    副驾驶侧车窗位置未关警告
    private String winStatusPassengerWarning;
    //    左后侧车窗位置未关警告
    private String winStatusDriverRearWarning;
    //    右后侧车窗位置未关警告
    private String winStatusPassengerRearWarning;
    //    驾驶侧车窗开启百分比
    private String winPosDriver;
    //    副驾驶侧窗开启百分比
    private String winPosPassenger;
    //    左后侧车窗开启百分比
    private String winPosDriverRear;
    //    右后侧车窗开启百分比
    private String winPosPassengerRear;
    //    天窗开启百分比
    private String sunroofPos;
    //    天窗未关窗警告(0: invalid 1: valid)
    private String sunroofOpenStatusWarning;


    public ClimateStatus() {
    }

    public void setWinStatusDriver(Integer winStatusDriver) {
        this.winStatusDriver = winStatusDriver;
    }

    public void setWinStatusPassenger(Integer winStatusPassenger) {
        this.winStatusPassenger = winStatusPassenger;
    }

    public void setWinStatusDriverRear(Integer winStatusDriverRear) {
        this.winStatusDriverRear = winStatusDriverRear;
    }

    public void setWinStatusPassengerRear(Integer winStatusPassengerRear) {
        this.winStatusPassengerRear = winStatusPassengerRear;
    }

    public void setSunroofOpenStatus(Integer sunroofOpenStatus) {
        this.sunroofOpenStatus = sunroofOpenStatus;
    }

    public void setInteriorTemp(Float interiorTemp) {
        this.interiorTemp = interiorTemp;
    }

    public void setExteriorTemp(Float exteriorTemp) {
        this.exteriorTemp = exteriorTemp;
    }

    public Integer getWinStatusDriver() {
        return this.winStatusDriver;
    }

    public Integer getWinStatusPassenger() {
        return this.winStatusPassenger;
    }

    public Integer getWinStatusDriverRear() {
        return this.winStatusDriverRear;
    }

    public Integer getWinStatusPassengerRear() {
        return this.winStatusPassengerRear;
    }

    public Integer getSunroofOpenStatus() {
        return this.sunroofOpenStatus;
    }

    public Float getInteriorTemp() {
        return this.interiorTemp;
    }

    public Integer getVentilateStatus() {
        return ventilateStatus;
    }

    public boolean isVentilateStatus() {
        return ventilateStatus != null && ventilateStatus == 1;
    }

    public Float getShowInteriorTemp() {
        if (this.interiorTemp == null) {
            return null;
        }
        return interiorTemp * 0.5f - 40;
    }

    public Float getExteriorTemp() {
        return this.exteriorTemp;
    }

    public int isSunroofNormal() {
        if (this.sunroofOpenStatus == null || this.sunroofOpenStatus.intValue() == SUNROOF_CLOSED) {//天窗状态为Null、0、1、或者负值均显示为关闭
            return SHOW_SUNFOOR_ClOSE;
        } else if (this.sunroofOpenStatus <= SUNROOF_POSITION_UNKNOWN) {
            return SHOW_SUNROOF_UNKOWN;
        } else {
            return SHOW_SUNFOOR_OPEN;
        }
    }

    //判断车窗是否关闭

    public boolean isWinClose(Integer winStatus) {
        if (winStatus == null) {//状态为null,车窗关闭
            return true;
        } else
            return !(winStatus == 0 || winStatus == 1);
    }


    /**
     * 左前窗
     *
     * @return
     */
    public boolean isWinDriverNormal() {
        return isWinClose(XChangeConstant.isLeftRudder ? winStatusDriver : winStatusPassenger);
    }

    public boolean isWinDriverRearNormal() {
        return isWinClose(winStatusDriverRear);
    }

    /**
     * 右前窗
     *
     * @return
     */
    public boolean isWinPassengerNormal() {
        return isWinClose(XChangeConstant.isLeftRudder ? winStatusPassenger : winStatusDriver);
    }

    public boolean isWinPassengerRearNormal() {
        return isWinClose(winStatusPassengerRear);
    }

    public boolean isAllWinNormal() {
        return this.isWinDriverNormal() && this.isWinDriverRearNormal() && this
                .isWinPassengerNormal() && this.isWinPassengerRearNormal();
    }

    public boolean isSeatHeatOpen(Integer seatHeatStatus) {
        if (seatHeatStatus == null) {
            return false;
        } else return seatHeatStatus == SEAT_HEAT_LEVEL1
                || seatHeatStatus == SEAT_HEAT_LEVEL2
                || seatHeatStatus == SEAT_HEAT_LEVEL3;
    }

    public boolean isDriverSeatHeatOpen() {
        return isSeatHeatOpen(drvHeatSts);
    }

    public boolean isPassengerSeatHeatOpen() {
        return isSeatHeatOpen(passHeatingSts);
    }

    public boolean isDriverRearSeatHeatOpen() {
        return isSeatHeatOpen(rlHeatingSts);
    }

    public boolean isPassengerRearSeatHeatOpen() {
        return isSeatHeatOpen(rrHeatingSts);
    }

    public boolean isSeatVentOpen(Integer seatVentOpen) {
        if (seatVentOpen == null) {
            return false;
        } else return seatVentOpen == SEAT_HEAT_LEVEL1
                || seatVentOpen == SEAT_HEAT_LEVEL2
                || seatVentOpen == SEAT_HEAT_LEVEL3;
    }

    public boolean isDriverSeatVentOpen() {
        return isSeatVentOpen(drvVentSts);
    }

    public boolean isPassengerSeatVentOpen() {
        return isSeatVentOpen(passVentSts);
    }

    public boolean isDriverRearSeatVentOpen() {
        return isSeatVentOpen(rlVentSts);
    }

    public boolean isPassengerRearSeatVentOpen() {
        return isSeatVentOpen(rrVentSts);
    }

    public boolean isAirCleanOpen() {
        return airCleanSts != null && airCleanSts == AIR_CLEAN_ON;
    }

    public boolean isSunroofInvalid() {
        return this.sunroofOpenStatus != null && this.sunroofOpenStatus.intValue() < 0;
    }

    public boolean isWinDriverInvalid() {
        return this.winStatusDriver != null && this.winStatusDriver.intValue() < 0;
    }

    public boolean isWinDriverRearInvalid() {
        return this.winStatusDriverRear != null && this.winStatusDriverRear.intValue() < 0;
    }

    public boolean isWinPassengerInvalid() {
        return this.winStatusPassenger != null && this.winStatusPassenger.intValue() < 0;
    }

    public boolean isWinPassengerRearInvalid() {
        return this.winStatusPassengerRear != null && this.winStatusPassengerRear.intValue() < 0;
    }

    public void setVentilateStatus(Integer ventilateStatus) {
        this.ventilateStatus = ventilateStatus;
    }

    public Integer getDrvHeatSts() {
        return drvHeatSts;
    }

    public void setDrvHeatSts(Integer drvHeatSts) {
        this.drvHeatSts = drvHeatSts;
    }

    public Integer getPassHeatingSts() {
        return passHeatingSts;
    }

    public void setPassHeatingSts(Integer passHeatingSts) {
        this.passHeatingSts = passHeatingSts;
    }

    public Integer getRlHeatingSts() {
        return rlHeatingSts;
    }

    public void setRlHeatingSts(Integer rlHeatingSts) {
        this.rlHeatingSts = rlHeatingSts;
    }

    public Integer getRrHeatingSts() {
        return rrHeatingSts;
    }

    public void setRrHeatingSts(Integer rrHeatingSts) {
        this.rrHeatingSts = rrHeatingSts;
    }

    public Integer getDrvVentSts() {
        return drvVentSts;
    }

    public void setDrvVentSts(Integer drvVentSts) {
        this.drvVentSts = drvVentSts;
    }

    public Integer getPassVentSts() {
        return passVentSts;
    }

    public void setPassVentSts(Integer passVentSts) {
        this.passVentSts = passVentSts;
    }

    public Integer getRrVentSts() {
        return rrVentSts;
    }

    public void setRrVentSts(Integer rrVentSts) {
        this.rrVentSts = rrVentSts;
    }

    public Integer getRlVentSts() {
        return rlVentSts;
    }

    public void setRlVentSts(Integer rlVentSts) {
        this.rlVentSts = rlVentSts;
    }

    public Boolean getPreClimateActive() {
        return preClimateActive == null ? false : preClimateActive;//by add zhanghui@2021/07/02 x70车型不支持空调字段返回
    }

    public void setPreClimateActive(Boolean preClimateActive) {
        this.preClimateActive = preClimateActive;
    }

    public String getCurtainOpenStatus() {
        return curtainOpenStatus;
    }

    public void setCurtainOpenStatus(String curtainOpenStatus) {
        this.curtainOpenStatus = curtainOpenStatus;
    }

    public String getWinStatusDriverWarning() {
        return winStatusDriverWarning;
    }

    public void setWinStatusDriverWarning(String winStatusDriverWarning) {
        this.winStatusDriverWarning = winStatusDriverWarning;
    }

    public String getWinStatusPassengerWarning() {
        return winStatusPassengerWarning;
    }

    public void setWinStatusPassengerWarning(String winStatusPassengerWarning) {
        this.winStatusPassengerWarning = winStatusPassengerWarning;
    }

    public String getWinStatusDriverRearWarning() {
        return winStatusDriverRearWarning;
    }

    public void setWinStatusDriverRearWarning(String winStatusDriverRearWarning) {
        this.winStatusDriverRearWarning = winStatusDriverRearWarning;
    }

    public String getWinStatusPassengerRearWarning() {
        return winStatusPassengerRearWarning;
    }

    public void setWinStatusPassengerRearWarning(String winStatusPassengerRearWarning) {
        this.winStatusPassengerRearWarning = winStatusPassengerRearWarning;
    }

    public String getWinPosDriver() {
        return winPosDriver;
    }

    public void setWinPosDriver(String winPosDriver) {
        this.winPosDriver = winPosDriver;
    }

    public String getWinPosPassenger() {
        return winPosPassenger;
    }

    public void setWinPosPassenger(String winPosPassenger) {
        this.winPosPassenger = winPosPassenger;
    }

    public String getWinPosDriverRear() {
        return winPosDriverRear;
    }

    public void setWinPosDriverRear(String winPosDriverRear) {
        this.winPosDriverRear = winPosDriverRear;
    }

    public String getWinPosPassengerRear() {
        return winPosPassengerRear;
    }

    public void setWinPosPassengerRear(String winPosPassengerRear) {
        this.winPosPassengerRear = winPosPassengerRear;
    }

    public String getSunroofPos() {
        return sunroofPos;
    }

    public void setSunroofPos(String sunroofPos) {
        this.sunroofPos = sunroofPos;
    }

    public String getSunroofOpenStatusWarning() {
        return sunroofOpenStatusWarning;
    }

    public void setSunroofOpenStatusWarning(String sunroofOpenStatusWarning) {
        this.sunroofOpenStatusWarning = sunroofOpenStatusWarning;
    }

    public String getCurtainWarning() {
        return curtainWarning;
    }

    public void setCurtainWarning(String curtainWarning) {
        this.curtainWarning = curtainWarning;
    }

    public String getCurtainPos() {
        return curtainPos;
    }

    public void setCurtainPos(String curtainPos) {
        this.curtainPos = curtainPos;
    }
}

